<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ page language="java" import="java.sql.*, java.io.*, java.util.*, database.*" %>
<jsp:useBean id="con" class="database.DatabaseConnection"/>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>News List</title>
<style type="text/css">
<!--
body {
	background-image: url(../../image/3110_background/backcolor3.jpg);
	background-repeat: repeat;
}
-->
</style></head>

<body>
<form>
  <table width="862" border="1" align="center">
    <tr>
      <td colspan="5" align="center" valign="middle">News List</td>
    </tr>
    <tr>
      <td width="103" align="center" valign="middle">ID</td>
      <td width="430" align="center" valign="middle">Full Name</td>
      <td width="158" align="center" valign="middle">Data</td>
      <td colspan="2" align="center" valign="middle">Action</td>
    </tr>

      <%
        con.createConnection();
        ResultSet rs = con.getNews();
        String ID = null;
        String NewsFullName = null;
        String Date_Time = null;

                    for (int j = 0; j < 8; j++) {
                        if (rs.next()) {
                            ID = rs.getString("ID");
                            NewsFullName = rs.getString("NewsFullName");
                            Date_Time = rs.getString("Date_Time");
                    %>
                    <tr align="left" valign="top">
                    <td align="center" valign="middle"><%=ID%></td>
                    <td align="center" valign="middle"><%=NewsFullName%></td>
                    <td align="center" valign="middle"><%=Date_Time%></td>
                    <td colspan="2" align="center" valign="middle"><a href="Edit Information.jsp?ID=<%=ID%>&title=<%=NewsFullName%>" target="mainFrame">Choose</a></td>
                    </tr>
                    <%
                        }
                    }
                    %>
  </table>
</form>
</body>
</html>
